// urveDlg.cpp : implementation file
//

#include "stdafx.h"
#include "curveDlg.h"


IMPLEMENT_DYNAMIC(CurveDlg, CDialog)

CurveDlg::CurveDlg(CWnd* pParent )
	: CDialog(CurveDlg::IDD, pParent)
{
	this->setLDialog( this);
	this->setLdlgid( CURVEDLG_ID);
}
CurveDlg::~CurveDlg()
{
}

int CurveDlg::init()
{
	lautoInitobj( &m_curve );
	//m_curve.linit();

	createDlg();
	return 0;
}
void CurveDlg::exit()
{
	//m_curve.lexit();

	this->DestroyWindow();
}


void CurveDlg::DoDataExchange(CDataExchange* pDX)
{
	CDialog::DoDataExchange(pDX);
}


BEGIN_MESSAGE_MAP(CurveDlg, CDialog)
	ON_WM_SIZE()
END_MESSAGE_MAP()


BOOL CurveDlg::OnInitDialog()
{
	CDialog::OnInitDialog();

	SetWindowText(TEXT("data"));
	RECT rc;
	this->GetClientRect( &rc );
	m_curve.Create(TEXT("adfa"), WS_CHILD|WS_VISIBLE|SS_RIGHT|WS_TABSTOP, rc, this );

	return TRUE;  // return TRUE unless you set the focus to a control
	// EXCEPTION: OCX Property Pages should return FALSE
}

void CurveDlg::OnSize(UINT nType, int cx, int cy)
{
	CDialog::OnSize(nType, cx, cy);

	RECT rc;
	this->GetClientRect( &rc );
	if( ::IsWindow( m_curve.GetSafeHwnd() ) )
	{
		m_curve.SetWindowPos( NULL, rc.left, rc.top, rc.right -rc.left, rc.bottom - rc.top, SWP_SHOWWINDOW );
	}
}

void CurveDlg::setCurvef( float * dbuf, int dlen)
{
	m_curve.onDataf( dbuf, dlen );	
}
void CurveDlg::setCurve( double * dbuf, int dlen )
{	
	m_curve.onData( dbuf, dlen );	
}
void CurveDlg::setCurved( ushort * dbuf, int dlen )
{
	m_curve.onDatad( dbuf, dlen );	
}
